tree grammar AmuthuTree;

options
{
    tokenVocab = Amuthu;
    ASTLabelType = CommonTree;
}

parenthesizedExpression
    :   ^(PARENTESIZED_EXPR expression)
    ;
    
expression
    :   ^(EXPRESSION expr)
    ;

expr
    :   ^(ASSIGN expr expr)
    |   ^(QUESTION expr expr expr)
    |   ^(OR expr expr)
    |   ^(AND expr expr)
    |   ^(EQUALS expr expr)
    |   ^(NOT_EQUALS expr expr)
    |   ^(LESSTHAN_EQ expr expr)
    |   ^(GREATERTHAN_EQ expr expr)
    |   ^(GREATERTHAN expr expr)
    |   ^(LESSTHAN expr expr)
    |   ^(PLUS expr expr)
    |   ^(MINUS expr expr)
    |   ^(MULT expr expr)
    |   ^(DIV expr expr)
    |   ^(MOD expr expr)
    |   ^(UNARY_PLUS expr)
    |   ^(UNARY_MINUS expr)
    |   ^(LOGICAL_NOT expr)
    |   primaryExpression
    ;

primaryExpression
    :   parenthesizedExpression
    |	  literal
    ;

literal 
    :   DECIMAL_LITERAL
    |   FLOAT_LITERAL
    |   BOOLEAN
    ;
